from rest_framework import serializers
from .models import BookInfo


class BookInfoModelSerializer(serializers.ModelSerializer):
    """定义序列化器"""
    class Meta:
        model = BookInfo  #序列化器指定从哪个模型去映射
        fields = '__all__'  #从model指定的模型中映射哪些字段